package com.ruoyi.orderview.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
/**
 * Author 许家森
 * Date 2022/2/22
 * Email 3448324670@qq.com
 */

@Mapper
public interface ChartsMapper {
    //查询生产资料对应的xx_purchase表，purchase_time为x轴，purchase_amount为y轴
    public List<Map<Object,Object>> selectPurchase(@Param("o") String origintime, @Param("e") String endtime, @Param("name") String a);
    //查询生产资料对应的xx_consume表，consume_time为x轴，，consume_amount为y
    public List<Map<Object,Object>> selectConsume(@Param("o") String origintime, @Param("e") String endtime, @Param("name") String a);
    //查询xx_consume_temporary表中的consume_time为x，consume_amount为y
    public List<Map<Object,Object>> selectConsumeTemporary(@Param("o") String origintime, @Param("e") String endtime, @Param("name") String a);
    //查询xx_return表中的return_time为x，return_amount为y
    public List<Map<Object,Object>> selectReturn(@Param("o") String origintime, @Param("e") String endtime, @Param("name") String a);
    //查询xx_amount表中的update_time为x，storage_amount为y
    public Double selectStorages(@Param("name") String a);
    //查询xx_purchase表中的purchase_time为x，total_price为y
    public List<Map<Object,Object>> selectPurcahseTotal(@Param("o") String origintime, @Param("e") String endtime, @Param("name") String a);
    //查询stroma_consume_temporary表中的数据
    public List<Map<Object,Object>> selectStromaConsumeTemporary(@Param("o") String origintime, @Param("e") String endtime);


    //已弃用，查询xx_amount表中的查询时间段的初始值，即离时间段最近的一条数据
    public Map<Object,Object> selectUpdateOrigin(@Param("o") String origintime, @Param("e") String endtime, @Param("name") String a, @Param("type") int type, @Param("typename") String typename);
    //已弃用，查询xx_amount表中有多少类型和类型id
    public List<Integer> selectAmountType(@Param("name") String a, @Param("idname") String id);
    //已弃用，查询xx_amount表中的update_time为x，storage_amount为y
    public List<Map<Object,Object>> selectUpdate(@Param("o") String origintime, @Param("e") String endtime, @Param("name") String a, @Param("idname") String id, @Param("type") String type);
}
